{extend name="admin@public/base" /}
{block name="main-content"}
<div class="page-content">

	<!--主题-->
	<div class="page-header">
		<h1>
			您当前操作
			<small>
				<i class="ace-icon fa fa-angle-double-right"></i>
				查看问题、操作问题
			</small>
		</h1>
	</div>
	<header id="top"></header>
	<a href="#foot1" class="back-to-top" style="font-size: 20px;"> 跳到尾部 </a>
	<a href="javascript:history.back(-1);" class="back-to-top" style="font-size: 20px;"> 返回上一页 </a>
	<!--隐藏发送问题id-->
	<input type="hidden" value="{$renwid}" name="renwid"/>
	<div class="row">
		<div id="table_pig">
			<!--问题内容-->
			<div class="form-group panel panel-default">
				<label class="col-md-2 " style="font-size: 15px;font-weight:900;"> 提交问题用户：{foreach admin_list as $k=>$v}{if $v.admin_id == $bug_list.fabry}{$v.admin_realname}{/if}{/foreach}</label>
				<label class="col-md-3 " style="font-size: 15px;font-weight:900;"> 产品：{foreach cp_list as $k2=>$v2}{if $bug_list['chanp_id'] != 0 && $v2['chanpid'] == $bug_list['chanp_id']}{$v2['chanpmc']}{/if}{/foreach}</label>
				<label class="col-md-3 " style="font-size: 15px;font-weight:900;"> 项目：{foreach $xm_list as $k2=>$v2}{if $bug_list['xiangm_id'] != 0 && $v2['xiangmid'] == $bug_list['xiangm_id']}{$v2['xiangmmc']}{/if} {/foreach}</label>
				<label class="col-md-3 " style="font-size: 15px;font-weight:900;color: red;"> 要求完成时间：{$bug_list['yaoqwcsj']}</label>
				<table class="table table-striped table-bordered table-hover" style="font-size:1.4rem; background: #F9F9F9;">
					<thead>
					<tr>
						<th>标题</th>
						<th>内容</th>
						<th>优先级别</th>
						<th class="hidden-xs">任务类型</th>
						<th>当前状态</th>
						<th class="hidden-xs">问题发布人</th>
						<th>阶段负责人</th>
						<th class="hidden-xs">发布时间</th>
					</tr>
					</thead>
					<tbody>
					<tr>
						<td class="col-md-2 col-xs-3" style=" vertical-align: middle !important;">#问题编号：{$bug_list['renwid']}<br />标题：{$bug_list['renwbt']}</td>
						<td class="col-md-4 col-xs-6">{$bug_list['renwnr']}</td>
						<td class="col-md-1 col-xs-1" style=" vertical-align: middle !important;">{foreach name="yxj_list" item="v"}{if $v['daimid'] ==$bug_list.youxjb}{$v['daimmc']}{/if}{/foreach}</td>
						<td class="hidden-xs col-md-1" style=" vertical-align: middle !important;">{foreach name="rwlx_list" item="v"}{if $v['daimid'] ==$bug_list.renwlx}{$v['daimmc']}{/if}{/foreach}</td>
						<td class="col-md-1 col-xs-1" style=" vertical-align: middle !important;">{foreach name="zhangt_list" item="v"}{if $v['daimid'] ==$bug_list.zhuangt}{$v['daimmc']}{/if}{/foreach}</td>
						<td class="hidden-xs col-md-1" style=" vertical-align: middle !important;">{foreach admin_list as $k=>$v}{if $v.admin_id == $bug_list.lzry}{$v.admin_realname}{/if}{/foreach}</td>
						<td class="col-md-1 col-xs-1" style=" vertical-align: middle !important;">{foreach admin_list as $k=>$v}{if $v.admin_id == $bug_list.jiedfzr}{$v.admin_realname}{/if}{/foreach}</td>
						<td class="hidden-xs col-md-1" style=" vertical-align: middle !important;">{$bug_list['fabsj']}</td>
					</tr>
				</table>
			</div>
			<div class="space-4"></div>
			<div class="space-4"></div>
			<div class="space-4"></div>
			<div class="space-4"></div>
			<div class="space-4"></div>
			<!--回复历史记录-->
			{foreach renwnr as $k1=>$v1} {if $v1['zirenwnr'] != '' && $bug_list['beizhu'] != $v1['zirenwnr']}
			<div class="form-group panel panel-default">
				<label class="col-sm-2 " style="font-size: 15px;font-weight:900;"> 流转问题用户：{foreach admin_list as $k=>$v}{if $v.admin_id == $bug_list.lzry}{$v.admin_realname}{/if}{/foreach}</label>
				<label class="col-sm-3 " style="font-size: 15px;font-weight:900;"> 产品：{foreach cp_list as $k2=>$v2}{if $bug_list['chanp_id'] != 0 && $v2['chanpid'] == $bug_list['chanp_id']}{$v2['chanpmc']} {/if} {/foreach}</label>
				<label class="col-sm-3 " style="font-size: 15px;font-weight:900;"> 项目：{foreach $xm_list as $k2=>$v2}{if $bug_list['xiangm_id'] != 0 && $v2['xiangmid'] == $bug_list['xiangm_id']}{$v2['xiangmmc']} {/if} {/foreach}</label>
				<label class="col-md-3 " style="font-size: 15px;font-weight:900;"> 本阶段预计完成时间：{$bug_list['jiedyjwcsj']}</label>
				<table class="table table-striped table-bordered table-hover" style="font-size:1.4rem; background: #F9F9F9;">
					<thead>
					<tr>
						<th>标题</th>
						<th>内容</th>
						<th>优先级别</th>
						<th class="hidden-xs">任务类型</th>
						<th>当前状态</th>
						<th class="hidden-xs">流转问题的人</th>
						<th>阶段负责人</th>
						<th class="hidden-xs">流转时间</th>
					</tr>
					</thead>
					<tbody>
					<tr>
						<td class="col-md-2 col-xs-3" style=" vertical-align: middle !important;">#问题编号：{$bug_list['renwid']}<br />标题：{$bug_list['renwbt']}</td>
						<td class="col-md-4 col-xs-6">{$v1['zirenwnr']}</td>
						<td class="col-md-1 col-xs-1" style=" vertical-align: middle !important;">{foreach name="yxj_list" item="v"}{if $v['daimid'] ==$bug_list.youxjb}{$v['daimmc']}{/if}{/foreach}</td>
						<td class="hidden-xs col-md-1" style=" vertical-align: middle !important;">{foreach name="rwlx_list" item="v"}{if $v['daimid'] ==$bug_list.renwlx}{$v['daimmc']}{/if}{/foreach}</td>
						<td class="col-md-1 col-xs-1" style=" vertical-align: middle !important;">{foreach name="zhangt_list" item="v"}{if $v['daimid'] ==$bug_list.zhuangt}{$v['daimmc']}{/if}{/foreach}</td>
						<td class="hidden-xs col-md-1" style=" vertical-align: middle !important;">{foreach admin_list as $k=>$v} {if $v['admin_id'] == $v1['fuzr']}{$v['admin_realname']}{/if}{/foreach}</td>
						<td class="col-md-1 col-xs-1" style=" vertical-align: middle !important;">{foreach admin_list as $k=>$v} {if $v['admin_id'] == $v1['jiedfzr']}{$v['admin_realname']}{/if}{/foreach}</td>
						<td class="hidden-xs col-md-1" style=" vertical-align: middle !important;">{$v1['lzsj']}</td>
					</tr>
					</tbody>
				</table>
			</div>
			<div class="space-4"></div>
			<div class="space-4"></div>
			<div class="space-4"></div>
			<div class="space-4"></div>
			<div class="space-4"></div>
			{/if}
			{/foreach}
			<!--问题关闭原因内容-->
			{if $bug_list['rw_state'] == 26}
			<div class="form-group panel panel-default">
				<label class="col-md-2 " style="font-size: 15px;font-weight:900;"> 关闭问题用户：{foreach admin_list as $k=>$v} {if $v['admin_id'] == $bug_list['gbry_id']}{$v['admin_realname']}{/if}{/foreach}  </label>
				<label class="col-md-3 " style="font-size: 15px;font-weight:900;"> 产品：{foreach cp_list as $k2=>$v2}{if $bug_list['chanp_id'] != 0 && $v2['chanpid'] == $bug_list['chanp_id']}{$v2['chanpmc']} {/if} {/foreach}</label>
				<label class="col-md-3 " style="font-size: 15px;font-weight:900;"> 项目：{foreach $xm_list as $k2=>$v2}{if $bug_list['xiangm_id'] != 0 && $v2['xiangmid'] == $bug_list['xiangm_id']}{$v2['xiangmmc']} {/if} {/foreach}</label>
				<label class="col-md-3 " style="font-size: 15px;font-weight:900;color: red;"> 要求完成时间：{$bug_list['yaoqwcsj']}</label>
				<table class="table table-striped table-bordered table-hover" style="font-size:1.4rem; background: #F9F9F9;">
					<thead>
					<tr>
						<th>标题</th>
						<th>问题关闭原因</th>
						<th>优先级别</th>
						<th class="hidden-xs">任务类型</th>
						<th>当前状态</th>
						<th class="hidden-xs">问题发布人</th>
						<th>阶段负责人</th>
						<th class="hidden-xs">发布时间</th>
					</tr>
					</thead>
					<tbody>
					<tr>
						<td class="col-md-2 col-xs-3" style=" vertical-align: middle !important;">#问题编号：{$bug_list['renwid']}<br />标题：{$bug_list['renwbt']}</td>
						<td class="col-md-4 col-xs-6">{$bug_list['beizhu']}</td>
						<td class="col-md-1 col-xs-1" style=" vertical-align: middle !important;">{foreach name="yxj_list" item="v"}{if $v['daimid'] ==$bug_list.youxjb}{$v['daimmc']}{/if}{/foreach}</td>
						<td class="hidden-xs col-md-1" style=" vertical-align: middle !important;">{foreach name="rwlx_list" item="v"}{if $v['daimid'] ==$bug_list.renwlx}{$v['daimmc']}{/if}{/foreach}</td>
						<td class="col-md-1 col-xs-1" style=" vertical-align: middle !important;">{foreach name="zhangt_list" item="v"}{if $v['daimid'] ==$bug_list.zhuangt}{$v['daimmc']}{/if}{/foreach}</td>
						<td class="hidden-xs col-md-1" style=" vertical-align: middle !important;">{foreach admin_list as $k=>$v}{if $v.admin_id == $bug_list.lzry}{$v.admin_realname}{/if}{/foreach}</td>
						<td class="col-md-1 col-xs-1" style=" vertical-align: middle !important;">{foreach admin_list as $k=>$v}{if $v.admin_id == $bug_list.jiedfzr}{$v.admin_realname}{/if}{/foreach}</td>
						<td class="hidden-xs col-md-1" style=" vertical-align: middle !important;">{$bug_list['fabsj']}</td>
					</tr>
				</table>
			</div>
			<div class="space-4"></div>
			<div class="space-4"></div>
			<div class="space-4"></div>
			<div class="space-4"></div>
			<div class="space-4"></div>
			{/if}
			<header id="foot1"></header>
			<div class="clearfix form-actions">
				<div class="col-md-offset-3 ">
					{if $bug_list['rw_state'] != 26}
					<button class="btn btn-success" data-toggle="modal" data-target="#myModal">
						<i class="ace-icon fa fa-check bigger-110"></i>
						接收任务
					</button>

					&nbsp; &nbsp;
					<button class="btn btn-info" data-toggle="modal" data-target="#myModal1">
						<i class="ace-icon fa fa-undo bigger-110"></i>
						流转任务
					</button>
					&nbsp; &nbsp;
					<button class="btn btn-danger" data-toggle="modal" data-target="#myModal2">
						<i class="ace-icon fa fa-times-circle bigger-110"></i>
						关闭问题
					</button>
					{/if}
				</div>
			</div>
			<a href="#top" class="back-to-top" style="font-size: 20px;"> 跳到头部 </a>
			<!-- 显示接收任务动态框（Modal） -->
			<div class="modal fade" id="myModal" aria-labelledby="myModalLabel" aria-hidden="true">
				<form class="form-horizontal" name="route_add" method="post" action="{:url('admin/Task/issue_jieshou')}">
					<input type="hidden" value="{$renwid}" name="renwid"/>
					<div class="modal-dialog">
						<div class="modal-content">
							<div class="modal-header">
								<button type="button" class="close" data-dismiss="modal"
										aria-hidden="true">×
								</button>
								<h4 class="modal-title" id="myModalLabel">
									接收任务操作
								</h4>
							</div>
							<div class="modal-body">

								<div class="row">
									<div class="col-xs-12">
										<div class="form-group">
											<label class="col-sm-2 control-label no-padding-right"> 负责人：  </label>
											<div class="col-sm-8">
												<input type="text" class="col-xs-10 col-sm-5" required readonly value="{foreach name="admin_list" item="v"}{if $v['admin_id']==$bug_list.jiedfzr} {$v['admin_realname']}{/if}{/foreach}"/>
											</div>
											<!--隐藏发送有效级别、阶段负责人-->
											<input type="hidden" value="{$bug_list['jiedfzr']}" name="jiedfzr"/>
											<input type="hidden" value="{$bug_list['youxjb']}" name="youxjb"/>
										</div>
										<div class="space-4"></div>

										<div class="form-group">
											<label class="col-sm-2 control-label no-padding-right"> 当前阶段：  </label>
											<div class="col-sm-8">
												<select name="jied" class="col-xs-10 col-sm-5" required>
													<option value="">请选择阶段</option>
													{foreach name="jied_list" item="v"}
													<option value="{$v['daimid']}" {if $v['daimid'] ==$bug_list.jied} selected{/if}>{$v['daimmc']}</option>
													{/foreach}
												</select>
												<span class="lbl col-xs-12 col-sm-7"><span class="red">*</span>请选择你当前的阶段</span>
											</div>
										</div>
										<div class="form-group">
											<label class="col-sm-2 control-label no-padding-right"> 是否搁置问题：  </label>
											<div class="col-sm-8">
												<select name="gezhi" class="col-xs-10 col-sm-5" required>
													<option value="0" selected>否</option>
													<option value="1">是</option>
												</select>
											</div>
										</div>
										<div class="space-4"></div>

										<div class="form-group">
											<label class="col-sm-2 control-label no-padding-right">预期完成日期：</label>
											<div class="col-sm-8">
												<input type="text" name="jiedyjwcsj" class="col-xs-10 col-sm-5 date-picker" required  value="{$bug_list['jiedyjwcsj']}" id="jieduan2"/>
												<span class="lbl col-xs-12 col-sm-7"><span class="red">*</span>要求完成时间:{$bug_list['yaoqwcsj']}</span>
											</div>
										</div>
										<div class="space-4"></div>

										<div class="form-group">
											<label class="col-sm-2 control-label no-padding-right"> 要求完成日期： </label>
											<div class="col-sm-8">
												<input type="text" name="yaoqwcsj" class="col-xs-10 col-sm-5 date-picker"  value="{$bug_list['yaoqwcsj']}" required/>
											</div>
										</div>
										<div class="space-4"></div>

									</div>
								</div>


							</div>
							<div class="modal-footer">
								<button type="submit" class="btn btn-primary">
									提交保存
								</button>
								<button class="btn btn-info" type="reset">
									重置
								</button>
								<button type="button" class="btn btn-default" data-dismiss="modal">
									关闭
								</button>
							</div>
						</div><!-- /.modal-content -->
					</div><!-- /.modal-dialog -->
				</form>
			</div><!-- /.modal -->

			<!-- 显示流转任务动态框（Modal） -->
			<div class="modal fade" id="myModal1" aria-labelledby="myModalLabel" aria-hidden="true">
				<form class="form-horizontal" name="route_add" method="post" action="{:url('admin/Task/issue_liuzhuan')}">
					<input type="hidden" value="{$renwid}" name="renwid"/>
					<div class="modal-dialog">
						<div class="modal-content">
							<div class="modal-header">
								<button type="button" class="close" data-dismiss="modal"
										aria-hidden="true">×
								</button>
								<h4 class="modal-title" id="myModalLabel1">
									流转任务操作
								</h4>
							</div>
							<div class="modal-body">

								<div class="row">
									<div class="col-xs-12">
										<div class="form-group">
											<label class="col-sm-2 control-label no-padding-right"> 负责人：  </label>
											<div class="col-sm-9">
												<select name="jiedfzr" id="select-2" class="col-xs-10 col-sm-6" required>
													{foreach name="admin_list" item="v"}
													<option value="{$v['admin_id']}" {if $v['admin_id'] ==$bug_list.jiedfzr} selected{/if}>{$v['admin_realname']}</option>
													{/foreach}
												</select>
											</div>
										</div>

										<div class="form-group">
											<label class="col-sm-2 control-label no-padding-right"> 任务类型： </label>
											<div class="col-sm-9">
												<select name="renwlx" class="col-xs-10 col-sm-6" required>
													<option value="">请选择类型</option>
													{foreach name="rwlx_list" item="v"}
													<option value="{$v['daimid']}" {if $v['daimid'] ==$bug_list.renwlx} selected{/if}>{$v['daimmc']}</option>
													{/foreach}
												</select>
											</div>
										</div>
										<div class="space-4"></div>

										<div class="form-group">
											<label class="col-sm-2 control-label no-padding-right"> 优先级别：  </label>
											<div class="col-sm-9">
												<select name="youxjb" id="youxjb1" class="col-xs-10 col-sm-6" required>
													<option value="0">请选择优先级别</option>
													{foreach name="yxj_list" item="v"}
													<option value="{$v['daimid']}" {if $v['daimid'] ==$bug_list.youxjb} selected{/if}>{$v['daimmc']}</option>
													{/foreach}
												</select>
											</div>
										</div>
										<div class="space-4"></div>

										<div class="form-group">
											<label class="col-sm-2 control-label no-padding-right"> 状态标志： </label>
											<div class="col-sm-9">
												<select name="ztbz" id="ztbz1" class="col-xs-10 col-sm-6" required>
													<option value="0">请选择状态</option>
													{foreach name="ztbz_list" item="v"}
													{if $v['daimid'] != 26 && $v['daimid'] != 27}
													<option value="{$v['daimid']}" {if $v['daimid'] ==$bug_list.biaoz} selected{/if}>{$v['daimmc']}</option>
													{/if}
													{/foreach}
												</select>
											</div>
										</div>
										<div class="space-4"></div>

										<div class="form-group">
											<label class="col-sm-2 control-label no-padding-right"> 要求完成日期： </label>
											<div class="col-sm-9">
												<input type="text" name="yaoqwcsj" class="col-xs-10 col-sm-6 date-picker"  value="{$bug_list['yaoqwcsj']}" required/>
											</div>
										</div>
										<div class="space-4"></div>

										<!--隐藏发送有效级别、发布人员-->
										<input type="hidden" value="{$bug_list['fabry']}" name="fabry"/>
										<div class="space-4"></div>

										<div class="form-group">
											<label class="col-sm-0 control-label" style="font-weight:900;"> 回复问题内容: </label><br />
											<div class="col-sm-10">
												<script src="__PUBLIC__/ueditor/ueditor.config.js" type="text/javascript"></script>
												<script src="__PUBLIC__/ueditor/ueditor.all.js" type="text/javascript"></script>
												<textarea name="renwnr" rows="100%" style="width:100%" id="myEditor"></textarea>
												<script type="text/javascript">
                                                    var editor = new UE.ui.Editor();
                                                    editor.render("myEditor");
												</script>
											</div>
										</div>
										<div class="space-4"></div>

									</div>
								</div>


							</div>
							<div class="modal-footer">
								<button type="submit" class="btn btn-primary">
									提交保存
								</button>
								<button class="btn btn-info" type="reset">
									重置
								</button>
								<button type="button" class="btn btn-default" data-dismiss="modal">
									关闭
								</button>
							</div>
						</div><!-- /.modal-content -->
					</div><!-- /.modal-dialog -->
				</form>
			</div><!-- /.modal -->

			<!-- 显示关闭任务动态框（Modal） -->
			<div class="modal fade" id="myModal2" aria-labelledby="myModalLabel" aria-hidden="true">
				<form class="form-horizontal" name="" method="post" action="{:url('admin/Task/issue_close')}">
					<input type="hidden" value="{$renwid}" name="renwid"/>
					<div class="modal-dialog">
						<div class="modal-content">
							<div class="modal-header">
								<button type="button" class="close" data-dismiss="modal"
										aria-hidden="true">×
								</button>
								<h4 class="modal-title" id="myModalLabel2">
									关闭任务操作
								</h4>
							</div>
							<div class="modal-body">
								<div class="row">
									<div class="col-xs-12">
										<!--隐藏发送发布人员-->
										<input type="hidden" value="{$bug_list['fabry']}" name="fabry"/>
										<!--隐藏发送阶段负责人-->
										<input type="hidden" value="{$bug_list['jiedfzr']}" name="jiedfzr"/>
										<div class="space-4"></div>
										<div class="form-group">
											<label class="col-sm-0 control-label" style="font-weight:900;"> 关闭问题备注: </label><br />
											<div class="col-sm-10">
												<textarea  id="beizhu" name="renwnr" cols="20" rows="8" class="col-xs-10 col-sm-7 limited3" maxlength="300"></textarea>
											</div>
										</div>
										<div class="space-4"></div>
									</div>
								</div>
							</div>
							<div class="modal-footer" id="bzguanbi">
								<button type="submit" class="btn btn-primary" id="tijiao">
									提交保存
								</button>
								<button type="button" class="btn btn-default" data-dismiss="modal">
									关闭
								</button>
							</div>
							<!--一个简单的jq，判断阶段负责人是否和当前操作人员一致，如果不一致提醒一下-->
							<script>
                                $("#tijiao").click(function(){
                                    var fuzr = {$bug_list['jiedfzr']};
                                    var admin_id = {$admin_id};
                                    //关闭问题备注不能为空
                                    var beizhu = $("#beizhu").val();
                                    if(beizhu == ''){
                                        alert('请输入要关闭的原因');
                                        return false;
                                    }else{
                                        if(fuzr != admin_id){
                                            if(confirm('你不是当前阶段负责人，你确定要关闭吗？')){
                                                return true;
                                            }else{
                                                return false;
                                            }
                                        }
                                        return true;
                                    }
                                });
							</script>
						</div><!-- /.modal-content -->
					</div><!-- /.modal-dialog -->
				</form>
			</div><!-- /.modal -->

			<div class="form-group">
				<label class="col-sm-2 control-label" style="font-weight:900;"> 附件下载：</label>
				<table class="table table-striped table-bordered table-hover" id="dynamic-table" style="font-size:1.4rem; background: #F9F9F9;">
					<thead>
					<tr>
						<th>附件名称</th>
						<th>上传者</th>
						<th>附件上传时间</th>
					</tr>
					</thead>
					<tbody id="ajax-data">
					{foreach file_list as $k=>$v}
					<tr>
						<td><a href="{$Think.const.HTTP_URL}{$v.path}">{$v.path|substr=24,100}</a></td>
						<td>{$v.up_user}</td>
						<td>{:date('Y-m-d H:i:s',$v.uptime)}</td>
					</tr>
					{/foreach}
					</tbody>
				</table>
			</div>
			<div class="space-4"></div>
		</div>
	</div>

</div>
{/block}
{block name="scripts"}
<script>
    $('.date-picker').datepicker({
        autoclose: true,
        todayHighlight: true,
        language: 'zh-CN',
    });
    $("#select-2").select2({
        allowClear:true,
    });
    $(".select2.select2-container.select2-container--default").width(256);
    $(".select2-selection__clear").html('');
    $.fn.modal.Constructor.prototype.enforceFocus = function() {}; //重写获取焦点
</script>
{/block}